<include file="Public:header" />
<div class="container">
  <div class="mainbody"> <include file="Public:redmenu" />
    <div class="rig_lm03">
      <div class="title" ><img src="{$Think.config.static_path}images/listicon.jpg" class="icon" >
        <h2>创建/编辑商户</h2>
      </div>
      <div class="detail-tab">
        <form name="form1"  enctype="multipart/form-data" method="post" action="__URL__/doStore" role="form" >
          <div class="form-group">
            <label for="name">商户名<i>*</i></label>
            <input type="text" name="title" class="searcheTxt"  id="name" placeholder="" value="{$data.title}">
          </div>
          <div class="form-group">
            <label for="name">电话<i>*</i></label>
            <input type="text" name="tel" class="searcheTxt"  id="name" placeholder="" value="{$data.tel}">
          </div>
          <div class="form-group">
            <label for="name">地址<i>*</i></label>
            <input type="text" name="address" class="searcheTxt"  id="name" placeholder=""  value="{$data.address}">
          </div>
          <div class="form-group">
            <label for="name">联系人<i>*</i></label>
            <input type="text" name="name" class="searcheTxt"  id="name" placeholder=""  value="{$data.name}">
          </div>
          <div class="form-group">
            <label for="startDate">开始时间<i>*</i></label>
            <input type="text" name="starttime" class="searcheTxt" id="start_time" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" placeholder="" value='{$data.starttime}'>
          </div>
          <div class="form-group">
            <label for="endDate">结束时间<i>*</i></label>
            <input type="text" name="endtime" class="searcheTxt" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" id="end_time" placeholder="" value='{$data.endtime}'>
          </div>
          <div class="form-group">
            <label for="name">抽奖次数<i>*</i></label>
            <input type="text" name="number" class="searcheTxt"  id="name" placeholder=""  value="{$data.number}">
          </div>
          <div class="form-group ">
            <label for="IbtnEnter"></label>
            <button type="button"  id="IbtnEnter" class="btn btn-primary "><span class="glyphicon glyphicon-floppy-saved"></span> 保 存 </button>
          </div>
          <input type="hidden" name="id" value="{$data.id}">
          <input type="hidden" name="activityId" value="{$activityId}">
        </form>
      </div>
    </div>
  </div>
</div>
<style type="text/css">
 .img{  width: 110px; height: 160px;}
 .img2{ width: 240px; height: 165px;}
</style>
<include file="Public:footer" /> 
<script type="text/javascript">

$(function(){
	$('#redadd').addClass('rig_seleli');
	$("#IbtnEnter").click(function(){
		   saveActivity();
	 });
	$("#IbtnEnter").click(function(){
		   saveActivity();
	 });
});

function saveActivity() {
    var state = true;
    if ($("#name").attr("value") == "") {
        alert("请输入姓名！");
        state = false;
        $("#name").focus();
        return false
    }
    
    if (state) {
       $("form").submit();
		//commonAjaxSubmit("__URL__/saveAddAvtivity","{$_REQUEST['id']}");
    }
};
</script>